<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\Index\IndexController;
use App\Http\Controllers\Guard\Setting\SysSettingController;
use App\Http\Controllers\Guard\Article\ArticleClassifyController;
use App\Http\Controllers\Guard\Article\ArticleInfoController;
use App\Http\Controllers\Guard\Advert\AdvertController;
use App\Http\Controllers\Guard\User\UserController;
use App\Http\Controllers\Guard\SerialNumber\SerialNumberController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);

//rbac权限管理
Route::group(['prefix'=>'rbac','middleware'=>'guard'],function(Router $router){

    $router->get('/getGuardUser',[IndexController::class,'getGuardUser']);
    $router->get('/loginLog',[IndexController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/getPermission',[PermissionController::class,'getRecord']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/getRole',[RoleController::class,'getRecord']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/getUser',[GuardUserController::class,'getRecord']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->post('/guardUser/edit',[GuardUserController::class,'edit']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);

});

//系统设置
Route::group(['prefix'=>'setting'],function(Router $router){

    $router->match(['get','post'],'/sys/index',[SysSettingController::class,'index']);

});

//广告管理
Route::group(['prefix'=>'advert'],function(Router $router){
    $router->get('/lst',[AdvertController::class,'lst']);
    $router->get('/del',[AdvertController::class,'del']);
    $router->get('/getAdvert',[AdvertController::class,'getRecord']);
    $router->match(['get','post'],'/add',[AdvertController::class,'add']);
});

//文章管理
Route::group(['prefix'=>'article'],function(Router $router){

    //分类
    $router->get('/classify/lst',[ArticleClassifyController::class,'lst']);
    $router->get('/classify/detail',[ArticleClassifyController::class,'getRecord']);
    $router->get('/classify/del',[ArticleClassifyController::class,'del']);
    $router->match(['get','post'],'/classify/add',[ArticleClassifyController::class,'add']);

    //列表
    $router->any('/uploadImg',[ArticleInfoController::class,'uploadImg']);
    $router->any('/uploadVideo',[ArticleInfoController::class,'uploadVideo']);
    $router->get('/lst',[ArticleInfoController::class,'lst']);
    $router->get('/detail',[ArticleInfoController::class,'getRecord']);
    $router->get('/del',[ArticleInfoController::class,'del']);
    $router->match(['get','post'],'/add',[ArticleInfoController::class,'add']);

});

//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->get('/driverLst',[UserController::class,'driverLst']);
    $router->get('/goLst',[UserController::class,'goLst']);
    $router->get('/driverExportXls',[UserController::class,'driverExportXls']);
    $router->get('/goExportXls',[UserController::class,'goExportXls']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/del',[UserController::class,'del']);
    $router->get('/exportXls',[UserController::class,'exportXls']);
    $router->get('/resetPassword',[UserController::class,'resetPassword']);
    $router->match(['get','post'],'/add',[UserController::class,'add']);

});

//序列号管理
Route::group(['prefix'=>'serial'],function(Router $router){

    $router->get('/lst',[SerialNumberController::class,'lst']);
    $router->get('/detail',[SerialNumberController::class,'detail']);
    $router->get('/del',[SerialNumberController::class,'del']);
    $router->get('/previewGenerate',[SerialNumberController::class,'previewGenerate']);
    $router->get('/exportXls',[SerialNumberController::class,'exportXls']);
    $router->get('/changeStatus',[SerialNumberController::class,'changeStatus']);
    $router->get('/addBeizhu',[SerialNumberController::class,'addBeizhu']);
    $router->match(['get','post'],'/generate',[SerialNumberController::class,'generate']);

});






